/*
 * Copyright (C) 2012 Matthias Zeimer and the miniframes community.
 * All rights reserved. 
 * 
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.opensource.org/licenses/EPL-1.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.miniframes.minijpa;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.persistence.Entity;
import javax.persistence.NoResultException;

/**
 * <p>
 * Indicates that the result of a enquiry method can be <code>null</code>.
 * </p>
 * 
 * <p>
 * As variant to the default behaviour, can the result of a
 * {@linkplain DatabaseEnquiryMethod database enquiry method} be
 * <code>null</code>, if it is marked with this annotation. This applies only to
 * enquires that deliver directly {@linkplain Entity Entities}, on other
 * enquiries, like those that deliver collections, this annotation has no effect
 * (their result could never be {@code null}).
 * </p>
 * 
 * <p>
 * <em>Note:</em> By default, <code>null</code> is not a valid result of a
 * database enquiry method, a {@link NoResultException} is thrown instead.
 * </p>
 * 
 * @author Matthias Zeimer
 * @version 1
 * @since 0.1, 17.06.2012
 */
@Documented
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface NullResultPossible {
    // This is a marker, therefore there is nothing to declare or define.
}
